package com.lebang.domain;

import com.lebang.model.ShanHuBussRecord;
import com.lebang.model.Whether;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * shanhu_buss_order
 * @author 
 */
@Data
@ApiModel("")
public class ShanhuBussOrder implements Serializable {
    /**
     * id
     */
    @ApiModelProperty("id")
    private Integer id;

    /**
     * 创建时间
     */
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    @ApiModelProperty("更新时间")
    private LocalDateTime modifyTime;

    /**
     * 逻辑删除
     */
    @ApiModelProperty("逻辑删除")
    private Integer hasDeleted;

    /**
     * 用户id
     */
    @ApiModelProperty("用户id")
    private String memberId;

    /**
     * 时间戳
     */
    @ApiModelProperty("时间戳")
    private Long timestamp;

    /**
     * 设备号
     */
    @ApiModelProperty("设备号")
    private String deviceid;

    /**
     * 金币值
     */
    @ApiModelProperty("金币值")
    private Integer coinnum;

    /**
     * appid
     */
    @ApiModelProperty("appid")
    private Integer appid;

    /**
     * 珊瑚订单号
     */
    @ApiModelProperty("珊瑚订单号")
    private String orderid;

    private String bizdata;

    /**
     * 扣积分原因
     */
    @ApiModelProperty("扣积分原因")
    private String reason;

    /**
     * 订单状态
     */
    @ApiModelProperty("订单状态")
    private Integer status;

    private static final long serialVersionUID = 1L;
    public ShanhuBussOrder() {

    }
    public ShanhuBussOrder(ShanHuBussRecord record) {
        this.appid=record.getAppid();
        this.bizdata=record.getBizdata();
        this.coinnum=record.getCoinnum();
        this.createTime=LocalDateTime.now();
        this.deviceid=record.getDeviceid();
        this.memberId=record.getAccountid();
        this.modifyTime=LocalDateTime.now();
        this.hasDeleted= Whether.NO.getDbIndex();
        this.orderid=record.getOrderid();
        this.reason=record.getReason();
        this.timestamp=record.getTimestamp();
        this.status=1;

    }
}